home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4721 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: hades.dcs.napier.ac.uk!styx!oose5009
  2. From: Alexander Higginson <oose5009@styx>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Help on Constructing Makefile in GNU/C++
  5. Date: Mon, 4 Mar 1996 12:47:24 +0000
  6. Organization: Computer Studies, Napier University, Edinburgh    
  7. Message-ID: <Pine.SOL.3.91.960304123307.1931A-100000@styx>
  8. NNTP-Posting-Host: styx.dcs.napier.ac.uk
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11.  
  12. Hi,
  13.    I am unclear on how to contruct a makefile within the GNU C++ compiler,
  14. which has more than one source file communicating with each other via a 
  15. header file.  For example, I have written a header file called PERSON.H 
  16. which contains a class Person and various operations and properties within 
  17. it.  I have also two .cc files called PERSON.CC and PERSON-IO.CC.  The 
  18. PERSON.CC contains the main() function which accesses the data members of 
  19. the class Person, which are in PERSON-IO.CC. The PERSON-IO.CC contains the 
  20. details of adding a person's name, age, display, etc.
  21.  
  22. I can compile the files by typing: g++ person.cc person-io.cc -o person.  
  23. This will compile and link the files together and produce an executable 
  24. called person.
  25.  
  26. However, it is not practicle to do this if you have over a dozen source 
  27. files to compile and link.  So it makes sense to construct a Makefile.
  28.  
  29. So how could this be done using a makefile?  I am unclear about the 
  30. various functions used within the Makefile and I would be grateful of a 
  31. sample Makefile that would cover the about problem.
  32.  
  33. Thanks,
  34.  
  35. Alexander Higginson.
  36. a.higginson@dcs.napier.ac.uk  or  oose5009@dcs.napier.ac.uk
  37.